// 封装axios
import axios from "axios"

const httpInstance = axios.create({
  baseURL: 'http://geek.itheima.net',
  timeout: 10000,
})

httpInstance.interceptors.request.use((config) => {
  return config
}, (error) => {
  return Promise.reject(error)
})

httpInstance.interceptors.response.use((response) => {
  return response.data
}, (error) => {
  // 非2xx响应
  return Promise.reject(error)
})

export default httpInstance